home *** CD-ROM | disk | FTP | other *** search
- DOS Vectrex Emulator (DVE V1.00)
- --------------------------------
-
- Author: Keith Wilkins (kwilkins@nectech.co.uk)
-
-
- *********************************************************************
-
- DVE is Copyright(c) 1995, 1996 by Keith Wilkins
-
- This licence grants you the following:
-
- Permission to use, copy, and distribute DVE in its entirety, for
- non-commercial purposes, is hereby granted without fee, provided that
- this license information and copyright notice appear in all copies.
-
- If you redistribute DVE, the entire contents of this distribution
- must be distributed. The software may be modified for your own
- purposes, but modified versions may NOT be distributed without prior
- consent from Keith Wilkins.
-
- This software is provided 'as-is', without any expressed or implied
- warranty. In no event will the author be held liable for any damages
- arising from the use of this software.
-
- If you would like to do something with DVE that this copyright
- prohibits (such as distributing it with a commercial product, using
- portions of the source in some other program, etc.), please contact
- the author.
-
- The author can be contacted via email at: kwilkins@nectech.co.uk
-
- *********************************************************************
-
-
- Vectrex EXEC ROM image Copyright(c) GCE 1983
-
-
- *********************************************************************
-
-
-
-
-
-
-
- Index
- -----
-
- 1.0 Installation
- 1.1 Game Images
-
- 2.0 Using DVE
- 2.1 Screen flicker
- 2.2 Default keys
- 2.3 VECTREX.INI Settings
- 2.4 Generating custom overlays
-
- 3.0 Emulator Development status
- 3.1 Misc history
- 3.2 Speed gripes
- 3.3 Emulation problems
-
- 4.0 With thanks to
-
- 5.0 Revision history
-
-
-
-
-
- 1.0 Installation
- ----------------
-
- Unpack all of the files into the directory of your choice.
-
- md c:\emu\dve
- cd c:\emu\dve
- pkunzip dve100.zip
- del dve100.zip
-
- This emulator should run on 386/486 machines but will run VERY slowly. The
- emulator runs OK on a P60, slow but playable. On my P120 it runs like a
- dream, 85% on some games.
-
- DVE does not use the Floating poing Co-Processor, it is all done in integer
- arithmatic.
-
- If you have UNIVBE installed it will help performance slightly. It also
- does wonders for Quake 8-)
-
- DVE now has sound thanks to Marcel De Kogel's emulation of the AY-3-8912
- using the Adlib emulation. Please don't complain about the quality of the
- sound I know the noise emulation is not perfect, but heh how much did you
- pay for DVE ?? I do this for love not money so I don't need the grief.
- If your machine is below a P60 in performance I'd advise you disable the
- sound emulation, the faster the machine the better it sounds (See 2.3)
-
-
-
-
- 1.1 Game images
- ---------------
-
- I did not wish to supply DVE with any images because of the copyright issue,
- I have only included the EXEC ROM as the one in the archive is corrupt and
- I don't wish to have people hassling about the fact that the emulator doesn't
- work when its the fault of a corrupt EXEC image.
-
- The sources of games that I know of are:
-
- A. ftp.csus.edu - /pub/vectrex/vectrex.tar.Z - Large collection of carts
- /pub/dktower/dktower.zip - Dark tower
-
- I have them converted into a ZIP file for easier access. I have posted
- them to the site maintainer for inclusion on the Archive.
-
-
- B. http://www.texel.com/home/pcjohn/index.html
-
- PCJohn's new vectrex games Patriot & Vectrex Vaders are available
- from his site in the section regarding about vectrex game development.
- Patriot is SUPERB and well worth downloading
-
-
- C. UK/US Vectrex home page
-
- http://www.parallax.co.uk/~lmw - Maintained by Lee Witek
- http://www.naples.net/~saturn/vectrex/dve - Maintained by Alan Ricotta
-
- D. Dave's classic emulation page
-
- http://www.csun.edu/~hbbuse08/classic.html
-
-
- There now seem to be a number of other sites with the zip, try searching
- for Vectrex on lycos.
-
-
-
- 2.0 Using DVE
- -------------
-
- You can run DVE straight out of the "pack" by just typing VECTREX
- and pressing return.
-
- If you wish to use a particular game image then.
-
- Usage: VECTREX <binary game image>
-
- There is a 2nd copy of DVE bunled in with the source release this can
- be run by typing:
-
- Usage: VECTDBG <binary game image>
-
- This has all of the DVE debugging functions built in and is useful
- for debugging or just disassembling games. I used it to cheat my way
- through to the secret game in patriot. Hit <ALT-M> during the game
- to invoke the debugger.
-
- If you don't specify an image then the default image from vectrex.ini will
- be loaded.
-
- Why not unpack Andrew Bond's menu program (menu17a.zip) and type menu.exe
- for a nice front end. You'll need the game pack, unpack all of the games
- into the DVE directory.
-
-
-
- 2.1 Screen flicker
- ------------------
-
- If you experience bad screen flicker try editing VECTREX.INI and changing
- the display_auto_refresh line to read:
-
- display_auto_refresh=0
-
- This will turn auto refresh off. When display_auto_refresh is set to
- zero then the line marked:
-
- display_update_period=30000
-
- is used to set the frequency with which the display is updated. You should
- not need to change this. If you do then the figures below will give some
- idea of what to expect.
-
-
- <5000 - Will give very very bad flicker
-
- 15000 - Acceptable image with some games, still bad flicker
-
- 30000 - Good stable image with most games
-
- >60000 - Stable image but lots of vector trails, may abort emulator if
- the vector trails become too long.
-
- When auto_refresh is set DVE will constantly adjust the display_update_period
- value to what it thinks is most optimum, BUT the method I use is not suitable
- for all cases, exceptions are Patriot & Spinball. The auto refresh has upper
- and lower refresh limits defined in the INI file:
-
- display_update_max=60000
- display_update_min=7500
-
-
-
-
- 2.2 Default Keys (Changeable in VECTREX.INI)
- ----------------
-
- A Vectrex joypad 1 button
- S Vectrex joypad 2 button
- D Vectrex joypad 3 button
- F Vectrex joypad 4 button
-
- Arrow keys are mapped to joystick left/right/up/down. Joystick is currently
- configured as a digital device, this messes up some things i.e Etch-a-sketch.
-
- If you wish to change the key bindings then this can be done in vectrex.ini
- by altering the relevant key maps, these should be speficied as scan codes.
-
-
- ALT-X Exit the emulator
- ALT-M Invoke the debug monitor
- ALT-R Reset (Warm Start)
- ALT-B Reboot emulator (Cold Start)
- ALT-P Pause
-
- ALT-F1 \
- . ▌
- . ▌ - Reset emulator and run cartridge assigned to relevant key
- . ▌ (Cartidge list defined in VECTREX.INI
- ALT-F12 /
-
-
- If you enter the debug monitor and wish to exit, press enter before entering
- any command as there is a bug in the keyboard driver that leaves unseen
- junk in the buffer and the 1st command you type will always be rejected:
-
- run Restart the emulator and exit the monitor
- quit Exit back to DOS
- help Display command list
-
-
-
-
- 2.3 VECTREX.INI
- ---------------
-
- Here are all the INI settings for those who wish to tinker:
-
- debug_enable 0/1 Enable/Disable debug logging
- debug_monitor 0/1 Boot straight into the debug monitor
- (Both disabled in released version)
-
- max_speed int Value between 1-1000 to set relative speed
- upper limit 100 = 100%
-
- sound_enable 0/1 Enable/Disable sound emulation (Adlib)
-
- display_enable 0/1 Enable/Disable screen emulation
-
- display_auto_refresh 0/1 Enable/Disable dynamic refresh estimation
-
- display_update_period int Number of system ticks between display refresh
-
- display_update_max int Bounding limits for auto refresh adjustment
- display_update_min int
-
-
- display_line_period int Number of refreshes a line will survive
- (Don't modify this)
-
- display_mode int System resolution:
- 0 - 640x480
- 1 - 800x600
- 2 - 1024x768
-
- display_enhance 0/1 Setting to one will cause DVE to repair
- any vector damage caused by undrawing
- old vectors. This will cause slght
- slowdown.
-
- display_clip_x int These values will set the screen clipping
- display_clip_y region. Default values are x=17000, y=18000
- These numbers are based on the vectrex screen
- resolution and are automatically scaled to the
- chosen screen mode.
-
- display_colour int Display colour 0-3 White,Red,Green,Blue
-
- rom_image string Name of system rom file
-
- rom_write_enable 0/1 Allows a program to write to the System
- ROM area if set to 1.
-
- ram_image string Name of ram image file
-
- default_cart string Name of default cartridge to run
-
- cart_write_enable 0/1 If set to 1 allows a program to write
- to the cartridge area.
-
- cartridge01 string Cartidge carousel files for F1-F12
- cartridge02
- cartridge03
- cartridge04
- cartridge05
- cartridge06
- cartridge07
- cartridge08
- cartridge09
- cartridge10
- cartridge11
- cartridge12
-
- player1button1 int Key bindings. Use the scancodes for the
- player1button2 keys of your choice
- player1button3
- player1button4
-
- player1up
- player1down
- player1left
- player1right
-
- player2button1
- player2button2
- player2button3
- player2button4
-
- player2up
- player2down
- player2left
- player2right
-
-
-
- 2.4 Custom overlays (.VOL files)
- --------------------------------
-
- The original vectrex had clear palstic overlays with nice borders that
- were supplied with each game. These gave some semblance of colour on
- the vectrex. DVE V1.0 upwards supports an electronic version of these
- overlays.
-
- I have generated one example file for Minestorm just to show how things
- work. I have added (as requested many times) the capability for both
- overlays and borders. It is up to you the users to generate the VOL files
- for the games. I don't have the time. I'm sure some kind sole has the
- time and inclination to generate a VOL file editor.
-
-
- COMMAND SYNTAX DEFINITION
-
- screen colour <pen> <intensity> <red> <green> <blue>
- screen clip <x1> <y1> <x2> <y2>
- screen offset <x1> <y1>
-
- overlay enable/disable
- overlay block <pen> <x1> <y1> <x2> <y2>
- overlay elipse <pen> <x1> <y1> <major axis> <minor axis>
-
- border line <pen> <intensity> <x1> <y1> <x2> <y2>
- border block <pen> <intensity> <x1> <y1> <x2> <y2>
- border elipse <pen> <intensity> <x1> <y1> <major axis/2> <minor axis/2>
-
-
-
- VALUE BOUNDS
-
- pen value 0 to 15
- intensity value 0 to 15
- red/green/blue 0 to 255
- x1/y1/x2/y2 -20000 to +20000
-
- NOTE: For x/y values you MUST keep these values exact multiples of 64.
- If you do not do this then you'll find that some of your items
- won't line up correctly. This is all due to the method used to
- convert vectrex coordinates to screen coordinate as it uses a
- a bit shift to divide.
-
-
-
- SCREEN COMMANDS
-
- screen colour <pen> <intensity> <red> <green> <blue>
-
- This command allows you to customise DVE's screen colour selection.
- You have a choice of 16 pens (0-15) and 16 intensities of each pen
- (0-15). I would suggest that you use pen 15 for setting up colours
- for use in the border setup. The red/green/blue values must all be
- in the range 0-255.
-
- You should define intensity 15 to be the brightest. Intensity 0
- should always be black (0 0 0). e.g.
-
- # Light blue gradient for pen 14
- screen colour 14 0 0 0 0
- screen colour 14 1 4 4 16
- screen colour 14 2 8 8 32
- screen colour 14 3 12 12 48
- screen colour 14 4 16 16 64
- screen colour 14 5 20 20 80
- screen colour 14 6 24 24 96
- screen colour 14 7 28 28 112
- screen colour 14 8 32 32 128
- screen colour 14 9 36 36 144
- screen colour 14 10 40 40 160
- screen colour 14 11 44 44 176
- screen colour 14 12 48 48 192
- screen colour 14 13 52 52 208
- screen colour 14 14 56 56 224
- screen colour 14 15 60 60 240
-
- Pens 0-3 have already been defined (you can overwrite them) in the
- following manner:
-
- Pen 0 - White
- Pen 1 - Red (255 0 0) - (0 0 0)
- Pen 2 - Green (0 255 0) - (0 0 0)
- Pen 3 - Blue (0 0 255) - (0 0 0)
-
- All other pens have been set to black (0 0 0) on all intensities.
-
-
- screen clip <x1> <y1> <x2> <y2>
-
- This will set the active clipping region for all vector drawing
- no vectors will be draw outside of this box. The vectrex screen
- coordinates go from about -20000 to +20000 units in both X and Y.
-
- Because of the linearity problem described in "Emulation Problems"
- some games need a wider clipping box than others (Vaders).
-
- screen offset <x1> <y1>
-
- This will allow you to shift the 0,0 origin around on the screen.
-
-
- OVERLAY COMMANDS
-
- These commands WILL NOT draw anything visible to the screen area unless
- you have the DEBUG command present in the VOL file. The overlay commands
- will generate the equivalent of the clear coloured plastic parts of the
- vecrex overlays.
-
- When used with the SCREEN COLOUR commands to define a pen/intensity
- selection and and OVERLAY XXXX commmand you can generate areas of the
- screen which will have different colour vectors. See my example
- SYSTEM.VOL file. When the screen beam passes over an overlay it will
- change colour to the given <pen> colour as defined by the SCREEN COLOUR
- commands.
-
- overlay enable/disable
-
- By default the overlay function is disabled because of the slight
- speed hit that it causes. It will not disable the drawing of any
- border or screen commands. So you can have borders without overlays
- if thats what you require.
-
- overlay block <pen> <x1> <y1> <x2> <y2>
- overlay elipse <pen> <x1> <y1> <major axis> <minor axis>
-
- These commands will generate an rectangular/eliptical coloured
- transparent areas. Whenever the vector beam passes over this area
- it will draw in the colours you have defined for <pen> with the
- SCREEN COLOUR command.
-
-
- BORDER COMMANDS
-
- These commands can be used for drawing the non-transparent parts of the
- vectrex overlays. You can setup the colours using the SCREEN COLOUR
- command. I would suggest you use pen 15.
-
-
- border line <pen> <intensity> <x1> <y1> <x2> <y2>
- border block <pen> <intensity> <x1> <y1> <x2> <y2>
- border elipse <pen> <intensity> <x1> <y1> <major axis/2> <minor axis/2>
-
- These commands will generate an rectangular/eliptical solid colour
- areas.
-
-
-
- 3.0 Current Status
- ------------------
-
- As far as I'm concerned DVE is pretty much complete at V1.0. I am not
- planning any further versions unless it is to bug fix V1.0.
-
- Most games are now playable, unless they use the 3D imager, as I have no
- info on this I can't make the emulator support it. There is still an
- image offset problem on some games, notably Spinball & Clean Sweep. I
- haven't tried to fix it yet.
-
- NOTE: If anyone out there has information on how the 3D system works
- then I'll attempt to emulate the 3D games (red/green glasses time)
-
- Some people have complained that the emulator doesn't work and hangs at the
- opening screen. This is NOT the case, the opening screen makes the emulator
- work very hard due to the number of vectors on screen even on a P120 speed
- drops off badly at this point, hence the programmed 4 second delay can
- stretch out to 50 seconds on a really slow machine. With the new hashing
- search on vectors for V1.0 then this should no longer be a problem.
-
- HINT: Press ALT-R at the reset scree, this will reset the emulator, by
- default the vectrex skips the opening screen on a warm reset.
-
- The vectrex.tar.Z file contained in the csus.ftp.edu archives contains an
- image of the vectrex system ROM (vectrex/binary/vecmon.com). DO NOT USE
- THIS FILE WITH THE EMULATOR as it is suffering from the advanced stages of
- bit rot and is badly corrupted. Many thanks to Marc Woodward for sending
- me an uncorrupted system image.
-
- Emulation speed: P75 approx 30-50% actual speed.
- P120 approx 50-90% actual speed
-
- Emulation speed has a lot to do with the number of vectors present on
- screen at a given time. I've put quite a lot of effort into optimising
- DVE but alas I've failed my goal of 100% on a P60. There are more things
- that can be done but its a law of diminishing returns.
-
- It seems on some graphics cards the 800x600 mode doesn't work correctly
- but I haven't figured out why. (Matrox Millenium)
-
-
-
- 3.1 History
- -----------
-
- DVE is written in Watcom 'C' and Assembler. All of the 6809 opcode emulation
- is 100% assembler, the main sequencing loops and all hardware emulation is
- still written in 'C'. The program uses my homebrew VESA setup and linedraw,
- not the fastest but much faster then the watcom libs.
-
- I started DVE back in March 1993, spent around 2 months on/off writing the
- debugger and disasembler. I then got bored and dropped the project in
- favour of something more interesting (doom most likely). There it sat until
- about Feb 96 when seening that someone (PCJohn) was writing new games it
- spurred me into action.
-
-
-
-
- 3.2 Speed Gripes
- ----------------
-
- For those people who complain that xxx emulator does 100% on a 8MHz 8086
- why can't DVE hack it, heres my reason why.
-
- The vectrex uses a 6809 running at 1.5Mhz (External clock is 6MHz)
-
- On a 60MHz Pentium this means I have only 40 Pentium clock cycles in
- which to emulate a single 6809 cycle. If you said that each pentium
- instruction takes 2 cycles then I can only execute 20 machine code
- instructions.
-
- For each emulated vectrex cycle the emulator must do the following:
-
- Update the 6809 model
- Update the 6522 model (shift register & 2 counters)
- Increment the time reference for hardware emulation
-
- The big problem is screen emulation, the emulator must keep a list of
- all vectors on screen at a given time. Any time a new vector is drawn
- it must be compared against all existing vectors to see if it is a
- new vector or an old one being re-drawn. The opening screen has around
- 300 vectors constantly being updated.
-
- Periodically the emulator must age the list of vectors in an attempt
- to emulate the persistance of the monitor, ie Undrawn vectors must
- fade away, all old vectors then have to be undrawn.
-
- Maybe now you have some idea why getting 100% speed is not as easy
- as it sounds.
-
-
- 3.3 Emulation Problems
- ----------------------
-
- There are two games I desparately wanted to get running perfectly as they
- are the only two with graphical faults : Clean Sweep & Spinball. It seems
- unlikely that the vector offset problem will be fixable without considerable
- effort on my part to improve the modelling of the integrators within the
- vectrex.
-
- The gist of the problem is that DVE models "perfect" integrators that always
- reach the point they were programmed to reach, in a linear fashion. On the
- real machine the integrators arent perfect, its this imperfection that is
- very hard to model correctly.
-
- The problem manifests itself slightly in most games, the most obvious is
- the non-centred text on the boot screen. This feature also prevents line
- clipping being implemented fully as the edge of the screen is in different
- places for many games, i.e Vectrex Vaders is much wider than others.
- Although each game can have its own VOL file and as such you can have
- different clipping for each game.
-
-
-
- 4.0 Many thanks to
- ------------------
-
- Lee Witek - For doing the Web page and being an all round mate.
- (Someday THE game WILL be finished)... Plum
-
- Alan Ricotta - For maintaining the US home page.
-
- Fred Taft - Without your dissasembly of the system ROM I'd have had
- a devil of a time sorting some of the bugs. It would have
- been impossible for me to rebuild system.img from the
- corrupt version.
-
- John Sandhoff - The kind soul who sent me the Vectrex System manual 3 years
- ago when I started this project.
-
- Phil Jones - (fil@muon.demon.co.uk) Many thanks for the code you released
- to x2ftp.oulu.fi for setting VESA modes.
-
- Mark Woodward - For the uncorrupted system image
-
- Brad Mott - Who licensing text I've borrowed & modified.
-
- Marcel De Kogel - For the use of his AY-3-8912 emulation for Adlib.
-
- Luc Miron - For producing menu.cfg
-
- Andrew Bond - For offering menu.zip for inclusion in DVE distribution.
-
-
- To all of those avid vectrex fans who've sent me email encouraging me.
-
-
-
-
- 5.0 Revision History
- --------------------
-
- 22/4/96 V0.01 - First public release of the emulator, work in progress.
-
- 23/4/96 V0.02 - Additional opcode emulation and bug fixes. Mine Storm
- now runs properly although buttons still cause exceptions
-
- 29/4/96 V0.03 - More opcodes, some bugfixing, some optimisation.
-
- 24/5/96 V0.04 - Bug-fixing.
- (Beta) Optimisation.
- 6809 Emulation completed
- Interrupt handling added.
- VESA Mode code added.
- linedraw code added.
- Some new INI options added: display_enhance
- Documentation overhaul
-
- 7/8/96 V1.00 - Hashing table added for line search.
- (~2x speed up on boot screen 19% -> 36%)
-
- Sound emulation added.
-
- Speed limiter has been added for the day when a machine
- is found that'll run DVE >100% (P133 or better should do it).
-
- Fixed Timer1/2 IRQ bug (Bedlam now works)
-
- Added custom overlay file capability (VOL files)
-
- Clipping modified to be screen mode independant, now
- based on vectrex screen coords,
-
- Fixed Dark Tower bug. Bug with Dark Tower not setting
- the direct page register correctly and using the 6522
- data direction register as a RAM location.
-
- Fixed Cosmic Chasm bug. Caused by typo in the opcode
- lookup table, some page 3 opcodes were calling page 2
- instructions.
-
-
- --- END OF FILE ---